#ifdef BUILD_WITH_FACEBOOK

#pragma  once

#include <QtNetwork/QNetworkCookieJar>

class CustomCookieJar : public QNetworkCookieJar
{
	bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url)
	{
		qDebug() << "Using custom cookie jar.";

		QList<QNetworkCookie> cookies = this->allCookies();
		foreach(QNetworkCookie cookie, cookieList)
		{
			qDebug() << "Cookie: " << cookie.toRawForm();
			cookies += cookie;
		}

		this->setAllCookies(cookies);
		return true;
	}
};

#endif